import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:myapp/util/sp_cache.dart';

class SplashPage extends StatefulWidget {
  const SplashPage({super.key});

  @override
  _SplashPageState createState() => _SplashPageState();
}

class _SplashPageState extends State<SplashPage> {
  @override
  void initState() {
    super.initState();
    Future delayFuture= Future.delayed(Duration(seconds: 1));

    SpCache.preInit().then((value) {
      return delayFuture;
    }).then((value){
      Get.offAllNamed('/home');
    })
    ;
  }

  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      body: Center(
        child: CircularProgressIndicator(),
      ),
    );
  }
}